<template>
  <div class="cointainer">
    <navbar name='值得买'></navbar>

    <div class="shopmain">
      <!-- 渐变 -->
      <div class="gradient">
        <img src="https://yanxuan.nosdn.127.net/a93a392fb8006ba26dea38477979b7b4.jpg?imageView" alt=""
          class="gradientImg" />
      </div>
      <div class="worthbuy">
        <img src="https://yanxuan.nosdn.127.net/0b7676e645253f84be662aacfc051922.png" alt="" class="worthbuyleft" />
        <div class="worthbuyright">严选好物 用心生活</div>
      </div>
      <!-- 轮播图 -->
      <div class="swipers">
        <van-swipe lazy-render indicator-color="red" class="swiper_main">
          <van-swipe-item>
            <div class="swiper_item">
              <van-grid column-num="4">
                <van-grid-item v-for="value in 8" :key="value" icon="photo-o" text="文字">
                  <van-image width="60px" height="60px"
                    src="https://yanxuan.nosdn.127.net/e92a567f96b94dcea29eafea9ab42440.png?imageView&quality=65&thumbnail=120y120"></van-image>
                  <div>好物大赏</div>
                  <div>购物先看榜</div>
                </van-grid-item>
              </van-grid>
            </div>
          </van-swipe-item>
          <van-swipe-item>
            <div class="swiper_item">
              <van-grid column-num="4">
                <van-grid-item v-for="value in 8" :key="value" icon="photo-o" text="文字">
                  <van-image width="60px" height="60px"
                    src="https://yanxuan.nosdn.127.net/75ab1b88df332b296cc420098ac7534e.png?imageView&quality=65&thumbnail=120y120"></van-image>
                  <div>好物大赏</div>
                  <div>购物先看榜</div>
                </van-grid-item>
              </van-grid>
            </div>
          </van-swipe-item>
        </van-swipe>
      </div>
      <div v-masonry fit-width="true" class="waterfall" transition-duration="0.1s">
        <div class="card" v-masonry-tile>
          <img class="card_Img" srcset=""
            src="https://yanxuan.nosdn.127.net/static-union/16564097538f53a1.jpg?imageView&thumbnail=345y191.66666666666669&quality=85" />
          <div class="card_title">7月必买好物榜</div>
          <div class="card_bot">
            <div class="itemleft">
              <img
                src="http://yanxuan.nosdn.127.net/3769578a6595d8e3c61d1186123141e0.png?imageView&quality=65&thumbnail=48y48"
                alt="" class="itemleftImg" />
              <p class="itemtitle">好物大赏</p>
            </div>
            <div class="itemRight">
              <van-icon name="eye-o" class="eye" />
              <span class="itemnum">8819</span>
            </div>
          </div>
        </div>
        <div class="card" v-masonry-tile>
          <img class="card_Img" srcset=""
            src="https://yanxuan.nosdn.127.net/60905aa5fb2fc782c2eb00f818ca978c.jpg?imageView&thumbnail=345y345&quality=85" />
          <div class="card_title">7月必买好物榜</div>
          <div class="card_bot">
            <div class="itemleft">
              <img
                src="https://yanxuan.nosdn.127.net/24dbfbc3271c8a503fa45f1e16740512.jpg?imageView&thumbnail=345y345&quality=85"
                alt="" class="itemleftImg" />
              <p class="itemtitle">好物大赏</p>
            </div>
            <div class="itemRight">
              <van-icon name="eye-o" class="eye" />
              <span class="itemnum">8819</span>
            </div>
          </div>
        </div>
        <div class="card" v-masonry-tile>
          <img class="card_Img" srcset=""
            src="https://yanxuan.nosdn.127.net/24dbfbc3271c8a503fa45f1e16740512.jpg?imageView&thumbnail=345y345&quality=85" />
          <div class="card_title">7月必买好物榜</div>
          <div class="card_bot">
            <div class="itemleft">
              <img
                src="http://yanxuan.nosdn.127.net/3769578a6595d8e3c61d1186123141e0.png?imageView&quality=65&thumbnail=48y48"
                alt="" class="itemleftImg" />
              <p class="itemtitle">好物大赏</p>
            </div>
            <div class="itemRight">
              <van-icon name="eye-o" class="eye" />
              <span class="itemnum">8819</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import navbar from '@/components/navbar/index.vue'
</script>

<style scoped lang="less">
.cointainer {
  background-color: #eee;
  height: 100%;

  .header {
    background-color: #eee;
    width: 96%;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;

    .title {
      font-size: 18px;
      flex: 1;
      padding-left: 50px;
      text-align: center;
    }

    .icon {
      margin-right: 5px;

      .icon_search {
        padding: 15px;
      }
    }
  }

  .shopmain {
    width: 100%;
    height: 345px;
    position: relative;
    top: 0px;

    .gradient {
      width: 100%;
      height: 100%;

      .gradientImg {
        width: 100%;
        height: 260px;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 0;
      }
    }

    .worthbuy {
      position: absolute;
      top: 25px;
      left: 10px;
      display: flex;

      .worthbuyleft {
        width: 65px;
        height: 35px;
      }

      .worthbuyright {
        margin-left: 3px;
        font-size: 15px;
        padding-top: 10px;
        color: white;
      }
    }

    .swipers {
      position: absolute;
      bottom: 0;
      left: 10px;
      height: 270px;
      background-color: #fff;
      width: 95%;
      border-radius: 5%;
      display: flex;
      justify-content: center;
      font-size: 12px;

      .swiper_main {
        width: 100%;
        height: 100%;
        border-radius: 5%;

        .swiper_item {
          width: 100%;
          height: 40%;
          display: flex;
        }
      }
    }

    .waterfall {
      width: 100%;
      box-sizing: border-box;
      padding: 10px;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      background-color: #eee;

      .card {
        border-radius: 5%;
        background-color: #fff;
        display: flex;
        flex-wrap: wrap;
        width: calc(100% / 2 - 20px);
        margin: 5px;

        .card_Img {
          width: 100%;
          border-radius: 2%;
        }

        .card_title {
          font-size: 14px;
          padding: 10px 10px;
        }

        .card_bot {
          width: 100%;
          height: 45px;
          display: flex;
          justify-content: space-between;
          color: #aaa;
          align-items: center;

          .itemleft {
            display: flex;
            align-items: center;
            font-size: 10px;

            .itemleftImg {
              width: 25px;
              height: 25px;
              border-radius: 50%;
              margin-left: 5px;
            }

            .itemtitle {
              margin-left: 5px;
              height: 25px;
              line-height: 25px;
            }
          }

          .itemRight {
            display: flex;
            align-items: center;

            .itemnum {
              font-size: 12px;
            }
          }
        }
      }
    }
  }
}
</style>
